package com.googlecode.mvcguice.util;

import java.util.Arrays;

public class Exceptions {
	private Exceptions() {
	}

	public static <T extends Throwable> T cutStackTrace(T e, int numberToRemoveFromTop) {
		StackTraceElement[] origStackTrace = e.getStackTrace();
		StackTraceElement[] stackTrace = Arrays.copyOfRange(origStackTrace, numberToRemoveFromTop,
				origStackTrace.length);
		e.setStackTrace(stackTrace);
		return e;
	}
}
